<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文章管理</title>
<link rel="stylesheet" type="text/css"
	href="${basePath}/css/style-1.css" />
<link rel="stylesheet" type="text/css"
	href="${basePath}/css/style_2_common.css" />
<link rel="stylesheet" type="text/css" href="${basePath}/css/cymain.css" />
<link rel="shortcut icon" type="image/ico" href="${basePath}/favicon.ico?v=1"/>
<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
<link rel="stylesheet" type="text/css"
	href="${basePath}/js/layer/skin/layer.css" />
<link rel="stylesheet" type="text/css"
	href="${basePath}/js/artDialog/skins/default.css" />
<script type="text/javascript" src="${basePath}/js/jquery.artDialog.js"></script>
<script type="text/javascript" src="${basePath}/js/layer/layer.m.js"></script>
<script type="text/javascript" src="${basePath}/js/upyun.js"></script>
<script type="text/javascript" src="${basePath}/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${basePath}/js/layerconfig.js"></script>
<script type="text/javascript" src="${basePath}/js/frames/common_uploader.js"></script>
<script type="text/javascript" src="${basePath}/js/ue/ueditor.config.js"></script>
<script type="text/javascript" src="${basePath}/js/ue/ueditor.all.js"></script>
<#include '/frame/taglib.html'>
</head>
<body id="nv_member" class="pg_CURMODULE">
	<#assign current='manage/articlemsg/index'>
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<!--中间内容-->
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
					<#include "/include/left.html"/> <#include "/include/wxtop.html"/>
					<div class="content">
						<div class="cLineB">
							<h4 class="left">添加文章</h4>
							<div class="clr"></div>
						</div>
<style>
.msgWrap {
	width: 900px;
}
</style>
						<#--
						<div style="background:#fefbe4;border:1px solid #f3ecb9;color:#993300;padding:10px;margin-bottom:5px;font-size:12px;">
						温馨提示：1.
						</div>
						-->
						<div class="msgWrap bgfc">
							<form id="actionform" action="">
							<#assign articleO=article >
								<table width="100%" cellspacing="0" cellpadding="0" border="0"
									style=" margin:0;" class="userinfoArea">
									<tbody>
										<tr>
											<th valign="top"><span class="red">*</span>栏目编号：</th>
											<td> 
											<select id="site_id"  name="site_id">
											 <#if listSite?exists>
											 <#list listSite as siteO>
											     <#assign site_id=(siteO.id!0)?c >
											  <option value ="${site_id!0}" <#if site_id??&&article??&&site_id==article.site_id > selected="selected" </#if> > ${siteO.name!"-"} </option>
											  </#list>
											  </#if>
											</select>
											 </td>
										</tr>
										<tr>
                                            <th valign="top"><span class="red">*</span>文章标题:</th>
                                            <td>
                                            <input type="input" style="width:200px" name="name" value="${articleO.name!}" id="name" class="px">
                                            </td>
                                        </tr>
                                        <#--
										<tr>
											<th valign="top"><span class="red">*</span>信息来源:</th>
											<td>
											<input type="input" style="width:200px" name="source" value="${articleO.source!}" id="source" class="px">
											</td>
										</tr>
										-->
										<tr>
                                            <th valign="top"><span class="red">*</span>发布时间:</th>
                                            <td>
                                                <input type="text" class="px" id="publish" value="  <#if articleO.publish??>${articleO.publish?string("yyyy-MM-dd HH:mm:ss")}</#if>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" name="publish" />
                                            </td>
                                        </tr>
										
										<tr>
                                            <th valign="top">作者信息:</th>
                                            <td>
                                            <input type="input" style="width:200px" name="author" value="${articleO.author!}" id="author" class="px">
                                        </tr>
                                        <tr>
                                            <th valign="top">简介信息:</th>
                                            <td>
                                            <input type="input" style="width:200px" name="summary" value="${articleO.summary!}" id="summary" class="px">
                                        </tr>
                                        <#--
                                        <tr>
                                            <th valign="top"><span class="red">*</span>封面图片:</th>
                                            <td>
                                               <input type="text" readonly class="px input_width_500" id="litpic" value="${articleO.litpic!}" name="litpic" />
                                                    <a href="javascript:void(0);" onclick="uploadImage(this,'articlemsg',0)" class="a_upload">上传</a>
                                                    <a href="javascript:void(0);" onclick="preViewImage(this)" class="a_upload">预览</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th valign="top"><span class="red">*</span>排序:</th>
                                            <td>
                                            <input type="input" style="width:200px" name="order" value="${articleO.order!0}" id="order" class="px" onKeyUp="{value=value.replace(/[^0-9]/g,'');if(value<0){value=0};}">
                                        </tr>
                                         -->
										 <tr>
                                            <th valign="top"><span class="red">*</span>正文信息:</th>
                                            <td id="td_right_component">
                                                <script id="container" name="content" type="text/plain">${articleO.content?default('')}</script>
                                            </td>
                                        </tr>
										<tr>
											<th></th>
											<td>
											<#if article?? && articleO.id??>
											 <input type="hidden" name="article_id" value="${articleO.id}">
											</#if>
												<button class="btnGreen" id="add_ajax" name="button"
														type="button" onclick="addAjax()">保存</button>&#12288;
												<a class="btnGray vm" href="${basePath}/admin/articlemsg/index">取消</a></td>
										</tr>
									</tbody>
								</table>
								    <input id="token" type="hidden" name="token" value="${token!}" />
							</form>
						</div>

					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
	</div>
	<#include "/include/footer.html"/>

<script type="text/javascript">
	function addAjax() {
		if (true) {//参数校验错误信息
			jQuery.ajax({
				url : "${basePath}/admin/articlemsg/save",
				dataType : 'json',
				type : 'POST',
				cache : false,
				async : false,
				data : jQuery("#actionform").serialize(),
				error : function(msg) {
					alert("系统繁忙,请稍后");
				},
				success : function(msg) {
			
						location.href = '${basePath}/admin/articlemsg/index';
					/* 	confirm("添加成功", function() {
							location.href = '${basePath}/admin/cointree/index';
						}); */
				}
			});
		} else {
		}
	}
</script>
<!-- 实例化编辑器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('container',{
             autoHeightEnabled : false,
             initialFrameWidth : 700,
             initialFrameHeight : 500,
             allowDivTransToP: false,
             toolbars: [[
                'source', //源代码
                'fontfamily', //字体
                'fontsize', //字号
                'forecolor', //字体颜色
                'bold', //加粗
                'italic', //斜体
                'underline', //下划线
                'strikethrough', //删除线
                'subscript', //下标
                'fontborder', //字符边框
                'superscript', //上标
                'indent', //首行缩进
                'pasteplain', //纯文本粘贴模式
                'selectall', //全选
                'preview', //预览
                'horizontal', //分隔线
                'removeformat', //清除格式
                'time', //时间
                'date', //日期
                'unlink', //取消链接
                'inserttable', //插入表格
                'inserttitle', //插入标题
                'deletetable', //删除表格
                'cleardoc', //清空文档
                'paragraph', //段落格式
                'simpleupload', //单图上传
                'insertimage', //多图上传
                'link', //超链接
                'emotion', //表情
                'spechars', //特殊字符
                'map', //Baidu地图
                'insertvideo', //视频
                'justifyleft', //居左对齐
                'justifyright', //居右对齐
                'justifycenter', //居中对齐
                'justifyjustify', //两端对齐
                'backcolor', //背景色
                'fullscreen', //全屏
                'imagenone', //默认
                'imageleft', //左浮动
                'imageright', //右浮动
                'imagecenter', //居中
                'lineheight', //行间距
                'attachment', //附件
                'edittip ', //编辑提示
                'autotypeset', //自动排版
                'touppercase', //字母大写
                'tolowercase', //字母小写
                'background', //背景
                'template', //模板
                'scrawl', //涂鸦
                'music', //音乐
                'charts', // 图表
            ]]
        });
        ue.addListener( 'ready', function( editor ) {
             layer.tips("<a href='javascript:void(0);' class='a_upload' onclick='openEditor();'>打开素材库</a>","#edui1_toolbarbox",{tips: [2, '#44b549'],time:0});
        });
        function openEditor(){
            var left = 460;//$("#td_right_component").offset().left;
            var height = ($(window).height()-10);
            layer.open({
                type: 2,
                area: [left+'px', height+'px'],
                fix: true,
                shade:false,
                offset: ['10px', '0px'],
                title: false,
                content: '${basePath}/anno/leditor'
            });
        }
        function insertIntoUe(content){
            //ue.setContent(content,true);
            ue.execCommand('inserthtml', content);
        }
    </script>
</body>
</html>